package me.mycollection;

import javax.print.DocFlavor;
import java.util.ArrayList;
import java.util.Collection;

public class A04_CollectionDemo4 {
    public static void main(String[] args) {
        //增强for遍历
        Collection<String> coll = new ArrayList<>();
        coll.add("zhangsan");
        coll.add("lisi");
        coll.add("wangwu");
        for(String s:coll){
            System.out.println(s);
        }
        //快速生成：集合名+for 回车
        //s只是第三方变量
        for (String s : coll) {
            s = "aaa";
        }
        System.out.println(coll);
    }
}
